import request from '@/utils/request'

export function orderTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/table`,
    method: 'post',
    data: query
  })
}

export function orderLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/load`,
    method: 'get',
    params: query
  })
}

export function orderDelete(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/delete/${id}`,
    method: 'post'
  })
}

export function orderDonate() {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/donate`,
    method: 'get'
  })
}

export function orderConfirm(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/confirm`,
    method: 'post',
    data: query
  })
}

export function orderSubmit(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/submit`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}

export function orderReturnTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/apply/return/table`,
    method: 'post',
    data: query
  })
}

export function orderReturnChangeStatus(id, status) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/apply/return/changeStatus/${status}`,
    method: 'get',
    params: {
      id: id
    }
  })
}

export function orderReturnDelete(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/apply/return/delete/${id}`,
    method: 'post'
  })
}

export function orderCheck(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/check/${id}`,
    method: 'post'
  })
}

export function orderVoice(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_MALL_API}/api/mall/order/voice/${id}`,
    method: 'post'
  })
}
